//Control implementation

#include "control.h"
#include <iostream>
using namespace std;

control::control(){
               array_data = new queue[1441];
               //cout << "Array data completed... " << endl;
               
               Customer_Obj start_customer = Customer_Obj();
               start_customer.createFirstNameArray();
               start_customer.createLastNameArray();
               
               for(int i = 0; i < 10; i++){
                       srand(time(NULL)+i);
                       int rr = rand();
                       srand(rr);
                       start_customer.setFirstName();
                       start_customer.setLastName();
                       start_customer.setArrivalTime();
                       start_customer.setActionTime(start_customer.getArrivalTime());
                       start_customer.setLineProcessTime(0);
                       cout << start_customer.getFirstName() << " arrives at " << start_customer.getArrivalTime() << endl;
                       (array_data[start_customer.getArrivalTime()]).enqueue(start_customer);
               }
}

Customer_Obj control::empty2store(sync sync_object){
             return(array_data[sync_object.return_time()].dequeue());
}

Customer_Obj control::peek(sync sync_object){
             return(array_data[sync_object.return_time()].peek());
}
             
             
